package org.spring.sample.common.config.client.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * post请求http://localhost:8881/bus/refresh已动态获取git配置文件，不用重启eureka服务
 * /bus/refresh?destination=customers:**  即刷新服务名为customers的所有服务，不管ip。
 *
 */
@RestController
@RefreshScope
public class IndexController {

	@Value("${version}")
	private String index;
	
	/**
	 * 访问git对应的资源问题
	 */
	@GetMapping(value = "/index")
	public String index() {
		return index;
	}
}
